Haxe Game Development Essentials by Jeremy McCurdy
Author:Jeremy McCurdy [McCurdy, Jeremy]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2015-11-26T05:00:00+00:00
As discussed before, we make a new TexturePackerData object and then use it to load graphics into our FlxSprite objects. We'll also be setting the visible property of the sprites to false so that we can play out the muzzle flash animation sequence.
Playing the flash
Let's build the function that will get called when the muzzle flash needs to get played. Like the explosion effect's play function, this is a public function, and it takes in x and y coordinates:
public function playFlash(x:Float, y:Float):Void { flash.setPosition(x + flashXOffset, y + flashYOffset); rings.setPosition(x + ringsXOffset, y + ringsYOffset); flash.scale.y = 0; flash.scale.x = 0; flash.alpha = 1; flash.visible = true; FlxTween.tween(flash.scale, { x:1,y:1 }, 0.1, { ease: FlxEase.quadIn,complete: showRings} ); }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Kotlin in Action by Dmitry Jemerov(17587)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11538)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(10483)
Odoo 15 Development Essentials - Fifth Edition by Daniel Reis & Greg Mader(3861)
Ember.js in Action by Joachim Haagen Skeie(3726)
Odoo 15 Development Essentials by Daniel Reis(2916)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2621)
Pride and Prejudice by Jane Austen(2454)
Learning Angular - Second Edition by Christoffer Noring(2448)
Computers For Seniors For Dummies by Nancy C. Muir(2127)
Mobile Forensics Cookbook by Igor Mikhaylov(2104)
Bulletproof Android: Practical Advice for Building Secure Apps (Developer's Library) by Godfrey Nolan(1988)
Android Development with Kotlin by Marcin Moskala & Igor Wojda(1899)
1936941139 (N) by Bob Rosenthal(1872)
Building Android UIs with Custom Views by Raimon Ràfols Montané(1867)
Hands-On Internet of Things with MQTT by Tim Pulver(1857)
Building Progressive Web Apps: Bringing the Power of Native to the Browser by Ater Tal(1845)
Android App Development by Franceschi Hervé J.;(1830)
Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz(1737)